package cn.signalpha.modules.social.controller.api;

import cn.signalpha.common.constant.AppConstant;
import cn.signalpha.common.enums.StatusEnum;
import cn.signalpha.core.boot.ctrl.BaseController;
import cn.signalpha.core.tool.api.R;
import cn.signalpha.modules.social.entity.TopicTag;
import cn.signalpha.modules.social.service.TopicTagService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;

import java.util.List;
import java.util.Map;

/**
 * 控制器
 *
 * @author signalpha
 */
@RestController
@AllArgsConstructor
@RequestMapping(AppConstant.APPLICATION_SOCIAL_NAME + "/wap/topic/tag")
@Api(value = "帖子标签", tags = "帖子标签")
public class ApiTopicTagController extends BaseController {

	private final TopicTagService topicTagService;

    @GetMapping("/list")
	@ApiImplicitParams({
		@ApiImplicitParam(name="isHot", dataType = "string", value = "是否热门"),
	})
    @ApiOperation(value = "列表", notes = "")
    public R<List<TopicTag>> list(@ApiIgnore @RequestParam Map<String, Object> params) {
		params.put("status", StatusEnum.ON.getType());
        return R.data(topicTagService.list(topicTagService.selectTopicTagWrapper(params)));
    }

}
